package com.wuhunyu.service;

import com.wuhunyu.commonutils.query.CommonQuery;
import com.wuhunyu.commonutils.result.CommonResult;
import com.wuhunyu.entities.EduCourse;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wuhunyu.entities.vo.CourseInfoVo;
import com.wuhunyu.entities.vo.CourseVo;
import com.wuhunyu.query.EduCourseQuery;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 课程 服务类
 * </p>
 *
 * @author wuhunyu
 * @since 2021-01-17
 */
public interface EduCourseService extends IService<EduCourse> {

    /**
     * 添加课程信息
     * @param courseInfoVo
     * @return
     */
    public CommonResult addCourse(CourseInfoVo courseInfoVo);

    /**
     * 根据课程id删除课程
     * @param id
     * @return
     */
    public CommonResult deleteCourse(String id);

    /**
     * 修改课程信息
     * @param courseInfoVo
     * @return
     */
    public CommonResult updateCourse(CourseInfoVo courseInfoVo);

    /**
     * 查询课程信息
     * @param courseId
     * @return
     */
    public CommonResult selectCourseInfo(String courseId);

    /**
     * 发布课程，修改课程状态为已发布
     * @param courseId
     * @return
     */
    public CommonResult updateStatus(String courseId);

    /**
     * 按条件查询课程列表
     * @param eduCourseQuery
     * @return
     */
    public CommonResult selectCourses(EduCourseQuery eduCourseQuery);

    /**
     * 查询前八条热门课程
     * @return
     */
    public CommonResult selectCourses();

    /**
     * 按条件查询课程
     * @param courseVo
     * @return
     */
    public CommonResult selectCourses(CourseVo courseVo);

    /**
     * 根据课程id查询课程相关信息
     * @param courseId
     * @param request
     * @return
     */
    public CommonResult selectCourseDetail(String courseId, HttpServletRequest request);

    /**
     * 根据课程id获取课程相关信息，提供给order订单
     * @param courseId
     * @return
     */
    public CommonResult selectCourseForOrder(String courseId);

    /**
     * 查询是否存在该课程
     * @param courseId
     * @return
     */
    public CommonResult isCourse(String courseId);

    /**
     * 查询课程信息
     * @param courseId
     * @return
     */
    public CommonResult selectCourseById(String courseId);

    /**
     * 批量修改课程状态
     * @param courseIds
     * @return
     */
    public CommonResult updateCourseStatus(String[] courseIds);

}
